package lesson7;

//二维数组
public class Demo1 {
    public static void main(String[] args) {
        //二维数组与一维数组的区别于联系
        //可以把一个二维数组看做一个一维数组，但是每一元素又是一个一维数组

        //静态初始化
        int[][] arr = {
                {1,2,3,4},
                {2,5,7,8,4,7,2},
                {5,77,88,11},
                {22,77,32,56}
        };
        //动态初始化
        int[][] arr2 = new int[10][10];
        //

        System.out.println("------------");
        int num = arr[1][2];
        arr[1][2] = 700;
       //System.out.println(num);
        for(int row = 0; row < arr.length; row++){
            for(int column = 0; column< arr[row].length; column++){
                System.out.print(arr[row][column]+"  ");
            }
            System.out.println();
        }
        System.out.println("**********************");

        for(int row = 0; row < arr2.length; row++){
            for(int column = 0; column< arr2[row].length; column++){
                System.out.print(arr2[row][column]+"  ");
            }
            System.out.println();
        }
        System.out.println("**********************");
        int[][] arr3 = new int[10][];
        int[][] arr4 = new int[10][];
/*        for(int row = 0; row < arr3.length; row++){
            for(int column = 0; column< arr3[row].length; column++){
                System.out.print(arr3[row][column]+"  ");
            }
            System.out.println();
        }*/
//        System.out.println(arr3.length);
//        System.out.println(arr3[1].length);
        //int[] temp = arr3[1];
//        for(int i = 0; i < arr3.length; i++){
//
//        }
        int[] temp = arr[3];
        for(int i = 0; i < temp.length; i++){

        }


//        int[][] arr = {
//                {1,2,3,4},
//                {2,5,7,8,4,7,2},
//                {5,77,88,11},
//                {22,77,32,56}
//        };
        int[] temp2 = arr[1];
        int[] tempp = {2,5,7,8,4,7,2};


    }
}
